/*
 * diskimg.h
 *
 *  Created on: 13-02-2012
 *      Author: Mateusz
 */

#ifndef DISKIMG_H_
#define DISKIMG_H_

/* MSC Disk Image Definitions */

/* Mass Storage 'Disk' Memory Layout */
#define MSC_MemorySize  ( BOOT_SECT_SIZE + FAT_SIZE + ROOT_DIR_SIZE + USER_FLASH_SIZE )
#define MSC_BlockSize   512
#define MSC_BlockCount  (MSC_MemorySize / MSC_BlockSize)

#define BOOT_SECT_SIZE 	MSC_BlockSize
#define ROOT_DIR_SIZE   (MSC_BlockSize * 1)
#define FAT_SIZE		(MSC_BlockSize * 2)

#define BLOCKS_PER_CLUSTER  1
#define NO_OF_CLUSTERS 	(MSC_BlockCount/BLOCKS_PER_CLUSTER)

#define DIR_ENTRY 64

extern unsigned char  Fat_RootDir[FAT_SIZE + ROOT_DIR_SIZE];  /* RAM to store the file allocation table */
extern const unsigned char RootDirEntry[12];                       /* Root directory entry constants */
extern const unsigned char BootSect[];

#endif /* DISKIMG_H_ */
